package com.icesoft.xsnow.upms.service.impl;


import cn.hutool.core.collection.CollUtil;
import com.icesoft.xsnow.framework.service.impl.BaseServiceImpl;
import com.icesoft.xsnow.upms.api.po.SysPermission;
import com.icesoft.xsnow.upms.mapper.SysPermissionMapper;
import com.icesoft.xsnow.upms.service.SysPermissionService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
/*
*Copyright © 2019 XSNOW
*四川瑞韬科技有限公司
*http://www.ratotech.com.cn
*All rights reserved.
*/

/**
 * @program: xsnow
 * @description: 权限表 服务实现类
 * @author xuefeng.gao
 * @create: 2019-05-27
 */
@Service
@AllArgsConstructor
public class SysPermissionServiceImpl extends BaseServiceImpl<SysPermissionMapper, SysPermission>implements SysPermissionService {

    /**
     * 通过角色id,查询Permission信息
     *
     * @param roleIds
     * @return
     */
    public List<String> findPermissionsByRoleIds(List<Integer> roleIds){
        if(CollUtil.isNotEmpty(roleIds)&&roleIds.size()>0){
            return mapper.listPermissionsByRoleIds(roleIds);
        }else{
            return null;
        }
    }
}
